package com.michael.demos.springboot.valid.model;

import com.michael.demos.springboot.valid.groups.F1;
import com.michael.demos.springboot.valid.groups.F2;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 类功能描述:
 * <pre>
 *   实体 - 水果
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2020/7/29 10:37
 */
@Data
public class Fruit implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 水果类型 */
    @NotBlank(message = "需要水果类型", groups = {F1.class})
    private String type;

    /** 水果数量 */
    @NotNull(message = "需要水果数量", groups = {F1.class, F2.class})
    private Integer counts;
}
